﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ThermalMarker.Utils;

namespace ThermalMarker.Entities
{
    class WayPoint
    {
        private double _latitude;
        private double _longitude;
        private double _altitude;

        public double Altitude
        {
            get { return _altitude; }
            set { _altitude = value; }
        }

        public WayPoint(string igcFileEntry)
        {
            if (igcFileEntry[0] == 'B')
            {
                Latitude = MathFunctions.ParseLatLng(igcFileEntry.Substring(7,8));
                Longitude = MathFunctions.ParseLatLng(igcFileEntry.Substring(15,9));
                Altitude = double.Parse(igcFileEntry.Substring(30,5));
            }
            else
            {
                return;
            }
        }

        public double Longitude
        {
            get { return _longitude; }
            set { _longitude = value; }
        }
        
        public double Latitude
        {
            get { return _latitude; }
            set { _latitude = value; }
        }

    }
}
